Skip to content

fix(#709): add missing org.springframework.http OSGi import in camel-cxf-all (backport of #720 on camel-karaf-4.18.x) - #721

Open
jbonofre wants to merge 1 commit into
apache:camel-karaf-4.18.xfrom
jbonofre:backport-709-cxf-all-spring-http-4.18.x
Open

fix(#709): add missing org.springframework.http OSGi import in camel-cxf-all (backport of #720 on camel-karaf-4.18.x)#721
jbonofre wants to merge 1 commit into
apache:camel-karaf-4.18.xfrom
jbonofre:backport-709-cxf-all-spring-http-4.18.x

Conversation

@jbonofre

@jbonofre jbonofre commented Jul 29, 2026

Copy link
Copy Markdown
Member

Backport of #720 to camel-karaf-4.18.x.

Fixes #709.

What

Adds the missing org.springframework.http* OSGi package import to the camel-cxf-all bundle.

Why

With the CXF version bundled in 4.18, org.apache.cxf.jaxrs.springmvc.SpringWebUtils references org.springframework.http.server.observation.ServerRequestObservationContext (Spring 6 / Micrometer observability). At runtime this failed with:

java.lang.NoClassDefFoundError: org/springframework/http/server/observation/ServerRequestObservationContext
    at org.apache.cxf.jaxrs.springmvc.SpringWebUtils.setHttpRequestURI(SpringWebUtils.java:51)
    ...
Caused by: java.lang.ClassNotFoundException:
    org.springframework.http.server.observation.ServerRequestObservationContext
    cannot be found by camel-cxf-all_4.18.2

camel-cxf-all enumerates specific Spring sub-packages in <camel.osgi.import> (aop, beans, context, core, util, web) but did not import org.springframework.http*. That package is a sibling of org.springframework.web, so org.springframework.web* does not cover it — the package was never wired and the class could not be found.

Note camel-cxf-spring-all is unaffected because it imports the org.springframework* wildcard.

Change

org.springframework.http*;resolution:=optional;version="${camel-osgi-spring-version}",

Marked resolution:=optional and versioned, consistent with the other optional Spring imports in this bundle (these Spring integrations are only used when Spring is on the classpath).

Scope

Karaf-specific packaging/OSGi-metadata delta only; no Camel-core change.

…camel-cxf-all

CXF's org.apache.cxf.jaxrs.springmvc.SpringWebUtils references
org.springframework.http.server.observation.ServerRequestObservationContext,
but camel-cxf-all only imported org.springframework.web* (and other specific
Spring sub-packages), not org.springframework.http*. This caused a runtime
NoClassDefFoundError / ClassNotFoundException for that class.

Add org.springframework.http* as an optional, versioned import, consistent
with the other optional Spring imports in this bundle.

Backport of apache#720 to camel-karaf-4.18.x.
@jbonofre jbonofre changed the title fix(#709): add missing org.springframework.http OSGi import in camel-cxf-all (backport of #720) fix(#709): add missing org.springframework.http OSGi import in camel-cxf-all (backport of #720 on camel-karaf-4.18.x) Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant